<?php
	include("Highscore.php");
	include("HighscoreList.php");
	
	$action = $_GET['action'];
	$difficulty = $_GET['difficulty'];
	$result = "OK";
	$list = new HighscoreList();
	
	if($action == "add")
	{
		$name = $_GET['name'];
		$level = $_GET['level'];
		$score = $_GET['score'];
		$date = $_GET['date'];
		$time = $_GET['time'];
		
		$highscore = new Highscore($name, $level, $score, $date, $difficulty, $time);
		$list->addHighscore($highscore);
	}
	
	if($action == "top10")
	{
		$result = $list->top10($difficulty);
	}
	
	if($action == "highscore")
	{
		$result = $list->highscore($difficulty);
	}
	
	print $result;
?>
